;
(function() {

	var role = require("./role");
	var BusCon = require("../../core/bus/_con");
	var UserCon = require("../../core/user/_con");
	var GoodsCon = require("../../core/goods/_con");
	var AchCon = require("../../core/ach/_con");
	var db = require("../../core/db/index");
	var config = require("../../core/_include/config");
	var ResponObj = require("../_include/responObj");
	module.exports = {
		prefix: "/bus/extend",
		get: {
			"/goods/end_pay/cb_url": function() {
				var bus = role.getBus(this);
				var query = this.request.query;
				var goods_id = query.goods_id;
				if (!goods_id) {
					throwCusError("参数错误");
				}
				this.body = ResponObj("json", bus.getGoodsEndPayCallbackBuff(goods_id));
			},
			"/invite/bus_list": function() {
				var bus = role.getBus(this);
				this.body = ResponObj("json", bus.getInviteBus());
			},
		},
		post: {
			"/goods/end_pay/cb_url": function() {
				var bus = role.getBus(this);
				var body = this.request.body;
				var goods_id = body.goods_id;
				var cb_url = body.cb_url;
				if (!(goods_id && cb_url)) {
					throwCusError("参数错误")
				}
				var goods = bus.setGoodsEndPayCallbackBuff(goods_id, cb_url, body.args);
				this.body = ResponObj("json", goods);
			},
		},
		put: {
		},
		"delete": {
		}
	}
}());